import request from "@/utils/request";

/**
 * 分页查询库存调拨单
 */
export const getAllotList = props => {
  return request({
    url: "/mall/tenant/inventory/allot/list",
    method: "post",
    data: props
  });
};
/**
 * 撤销调拨
 */
export const revoke = props => {
  return request({
    url: "/mall/tenant/inventory/allot/revoke",
    method: "post",
    data: props
  });
};
/**
 * 删除调拨单
 */
export const allotDel = props => {
  return request({
    url: "/mall/tenant/inventory/allot/delete",
    method: "post",
    data: props
  });
};
/**
 * 获取调拨单查询详情
 */
export const getDetail = props => {
  return request({
    url: `/mall/tenant/inventory/allot/getDetail/${props.allotId}`,
    method: "get"
  });
};
/**
 * 查询商品分类
 */
export const getCategoryList = props => {
  return request({
    url: "/mall/tenant/inventory/allot/getCategoryList",
    method: "post",
    data: props
  });
};

/**
 * 查询商品库存信息-选择商品
 */
export const getProductInventory = props => {
  return request({
    url: "/mall/tenant/inventory/allot/getProductInventory",
    method: "post",
    data: props
  });
};
/**
 * 保存商品库存信息-选择商品
 */
export const addSelectProducts = props => {
  return request({
    url: "/mall/tenant/inventory/allot/addSelectProducts",
    method: "post",
    data: props
  });
};
/**
 * 获取商品库存信息-选择商品
 */
export const getSelectedProducts = props => {
  return request({
    url: `/mall/tenant/inventory/allot/getSelectedProducts/${props.allotKey}`,
    method: "get"
  });
};
/**
 * 移除商品库存信息-选择商品
 */
export const removeAllotProduct = props => {
  return request({
    url: "/mall/tenant/inventory/allot/removeAllotProduct",
    method: "post",
    data: props
  });
};
/**
 * 创建调拨单
 */
export const create = props => {
  return request({
    url: "/mall/tenant/inventory/allot/create",
    method: "post",
    data: props
  });
};

/**
 * 获取客户列表
 */
export const getCustomerInfo = props => {
  return request({
    url: "/mall/tenant/inventory/allot/getCustomers",
    method: "post",
    data: props
  });
};
